package com.example.demo2.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.example.demo2.dao.JsonReader;

import java.util.*;

public class Check {
//    String path = JsonRead.class.getClassLoader().getResource("json/PassengerData.json").getPath();
//    String s = JsonRead.readJsonFile(path);
//    JSONObject passengerList = JSON.parseObject(s);
//    JSONArray passenger = passengerList.getJSONArray("Passenger");//构建JSONArray数组
//    public JSONObject bookingNumcheck (String bookingNum){
//        for (int j =0;j<passenger.size();j++){
//            if (passenger.getJSONObject(j).getString("bookingNum")==bookingNum){
//                JSONObject object = passenger.getJSONObject(j);
//            }
//        }
//        return object;
//    }
//
//    public static boolean surnameIdcheck(String surName,String id){
//        boolean checkbool = false;
//        if("Harden".equals(surName)&&"130121200108190014".equals(id)){
//            checkbool = true;
//        }
//        return checkbool;
//    }
//    for(int i=0;i < passenger.size(); i++) {
//        JSONObject data = (JSONObject) passenger.getJSONObject(i);
//        String firstName = data.getString("firstName");
//        String surName = data.getString("surName");
//        String BookingNum = data.getString("BookingNum");
//        String id = data.getString("id");
//        String Flight =data.getString("Flight");
//        String Date =data.getString("Date");
//        String departureTime =data.getString("departureTime");
//        String arrivingTime =data.getString("arrivingTime");
//        String duration =data.getString("duration");
//        String departure =data.getString("departure");
//        String destination =data.getString("destination");
//        String creditCard =data.getString("creditCard");
//        String creditCode =data.getString("creditCode");
//        String seatNum =data.getString("seatNum");
//        String classLevel = data.getString("class");
//        String gate =data.getString("gate");
//        String boardingTime =data.getString("boardingTime");
//        String cz =data.getString("cz");
//        String bagDrop =data.getString("bagDrop");
//        String bag =data.getString("bag");
//        Boolean isVIP = data.getBoolean("isVIP");
//        Boolean isExtraleg = data.getBoolean("isExtraleg");
//        Boolean isNormalfood =data.getBoolean("isNormalfood");
//        Boolean isRofresh = data.getBoolean("isRofresh");
//        Boolean isSeafood = data.getBoolean("isSeafood");
//        String other = data.getString("other");
////            passengers.add(new Passenger(firstName,surName,BookingNum,id,Flight,Date,departureTime,arrivingTime,duration,departure,destination,creditCard,creditCode,seatNum,classLevel,gate,boardingTime,cz,bagDrop,bag,isVIP,isExtraleg,isNormalfood,isRofresh,isSeafood,other));
//    }



}

